Published German patent document DE 196 23 334 describes a device for determining the mass of a medium flowing in a line, having a part which is inserted into the line and in which a measuring channel having a measuring element is situated. Devices of this kind are used, for example, as air-mass meters in the air-intake tract of an internal combustion engine. Spray water and dust, which are transported by the medium, are able to enter the air-intake tract. Moreover, when shutting down the internal combustion engine, oil vapor may enter the air-intake tract through the crankshaft ventilation inlet. In the known device, the fluid or solid particles transported with the medium can penetrate into the measuring channel and soil the measuring element. The resulting change of the sensor characteristic leads to disadvantageous deviations of the measuring results from the actually obtaining values.